package com.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.dao.UrgencyDao;
import com.model.Astuff;
import com.model.Urgency;
import com.service.UrgencyManagger;

@Component("urgencyManager")
public class UrgencyManagerImpl implements UrgencyManagger {
	private UrgencyDao urgencyDao;

	public UrgencyDao getUrgencyDao() {
		return urgencyDao;
	}

	@Resource
	public void setUrgencyDao(UrgencyDao urgencyDao) {
		this.urgencyDao = urgencyDao;
	}

	public Urgency getUrgencyById(String urgencyid) {
		return urgencyDao.getUrgencyById(urgencyid);
	}

	public List<Urgency> getUrgencyListByUser(Astuff astuff, int offset,
			int length) {
		return urgencyDao.getUrgencyListByUser(astuff, offset, length);
	}

	public Long getUrgencyCountByUser(Astuff astuff) {
		return urgencyDao.getUrgencyCountByUser(astuff);
	}

	public Long getUnReadUrgencyCountByUser(Astuff astuff) {
		return urgencyDao.getUnReadUrgencyCountByUser(astuff);
	}

	public List<Urgency> getUnReadUrgencyListByUser(Astuff astuff, int offset,
			int length) {
		return urgencyDao.getUnReadUrgencyListByUser(astuff, offset, length);
	}

	public void setUrgencyReaded(Astuff astuff, String urgencyid) {
		urgencyDao.setUrgencyReaded(astuff, urgencyid);
	}

}
